import { Button as AntButton, type ButtonProps } from 'antd';
import { forwardRef } from 'react';

export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
  return (
    <AntButton
      {...props}
      ref={ref}
      onClick={(e) => {
        // 自定义波纹效果
        const ripple = document.createElement('div');
        ripple.className = 'ripple';
        const button = e.currentTarget;
        button.appendChild(ripple);
        setTimeout(() => button.removeChild(ripple), 600);
        props.onClick?.(e);
      }}
    />
  );
});

Button.displayName = 'Button'; 